package com.ityu.mapper;

import com.ityu.pojo.Student;
import com.ityu.pojo.pagePojo.StudentPage;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StudentMapper {

    List<Student> pageFindStudents(StudentPage studentPage);


    void bachDeleteStudents(List<Integer> ids);

    @Insert("insert into student(name,no,gender,phone,id_card,is_college,address,degree,graduation_date,clazz_id,violation_count,violation_score,create_time,update_time) " +
            "values(#{name},#{no},#{gender},#{phone},#{idCard},#{isCollege},#{address},#{degree},#{graduationDate},#{clazzId},#{violationCount},#{violationScore},#{createTime},#{updateTime})")
    void addStudent(Student student);

    @Select("select * from student where id = #{id}")
    Student selectStudentById(Integer id);


    void updateStudent(Student student);


}
